import Taro, { Component, Config } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
import './index.less';

import Banner from '../../components/banner/index';
import IBanner from '../../components/banner/index';


import Hot from '../../components/hot_List/index';


export default class Index extends Component {

  static options = {
    addGlobalClass: true,
  }
  
  config: Config = {
    navigationBarTitleText: '首页',
    backgroundColor: '#aaaaaa'
  }

  componentWillMount () { }

  componentDidMount () { }

  componentWillUnmount () { }

  componentDidShow () { }

  componentDidHide () { }

  state = {
      businessHours: {
        begin: '06:00',
        end: '24:00'
      },
      
      greetTime: '晚上好。',
      address: '结界大厦',

      banner: [
        {
            path: '/',
            url: 'https://alioss.g-cores.com/uploads/focus_image/b57d1c59-6684-43b4-8886-85b5acf8d93f.jpg'
        },

        {
            path: '/',
            url: 'https://alioss.g-cores.com/uploads/focus_image/fb777aed-34b4-49f5-889b-561844144505.jpg'
        }
      ]
  }
  
  

  render () {
    let { 

      businessHours,
      greetTime,
      address,
      banner,
      
     } = this.state;

    return (

      
      <View className='index'>

        <View className="header">
            <View className="business-hours">
              营业时间： {businessHours.begin} - {businessHours.end} 
            </View>

            <View className="header-content">

              <View className="greet-time">
                  {greetTime}
              </View>
              
              <View className="address-container">
                配送至: <Text className='address'> {address} </Text>
              </View>
                
            </View>
            
          </View>

          <Banner imgs={banner}></Banner>
          
          <View className="body">

            <Hot></Hot>

          </View>
          
      </View>
    )
  }
}

